const { fetchConstants } = require('./fetchService');
const { writeFiles } = require('./fileWriter');
const config = require('./config');

async function sync() {
  console.log('🔄 开始同步常量数据...');
  try {
    const constantsMap = await fetchConstants();
    await writeFiles(constantsMap);
    console.log('✨ 同步完成');
  } catch (error) {
    console.error('❌ 同步失败:', error.message);
  }
}

// 立即执行一次
sync();